package com.example.f8399.testdemo.activity;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomNavigationView;
import android.view.MenuItem;

import com.blankj.utilcode.util.ToastUtils;
import com.example.f8399.testdemo.BaseActivity;
import com.example.f8399.testdemo.R;
import com.example.f8399.testdemo.databinding.ActivityBottomNavigationBinding;

/**
 * @author lcfeng
 * @description 底部栏.
 * @date 2018/9/18 11:37.
 **/
public class BottomNavigationActivity extends BaseActivity {


    ActivityBottomNavigationBinding mBinding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mBinding = DataBindingUtil.setContentView(this, R.layout.activity_bottom_navigation);

        mBinding.bottomNavigation.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
            @Override
            public boolean onNavigationItemSelected(@NonNull MenuItem item) {
                switch (item.getItemId()) {
                    case R.id.remote_control:
                        ToastUtils.showShort("remote_control");
                        break;
                    case R.id.remote_notify:
                        ToastUtils.showShort("remote_notify");
                        break;
                    case R.id.remote_people:
                        ToastUtils.showShort("remote_people");
                        break;
                }
                return true;
            }
        });
    }
}
